Skip to content

feat(openfeature): support long variable evaluation - #196

Merged
jonathannorris merged 4 commits into
mainfrom
worktree-of-long-support
Aug 7, 2026
Merged

feat(openfeature): support long variable evaluation#196
jonathannorris merged 4 commits into
mainfrom
worktree-of-long-support

Conversation

@jonathannorris

@jonathannorris jonathannorris commented Jul 30, 2026

Copy link
Copy Markdown
Member

Summary

  • Add Long evaluation support by upgrading the OpenFeature SDK to 1.22.0.

Why no custom override

DevCycle stores numbers as Double, so the SDK default safely converts them to long and returns TYPE_MISMATCH for fractional or out-of-range values. A custom override would add no capability and could remove these safeguards.

@jonathannorris jonathannorris changed the title feat(openfeature): add long variable support feat(openfeature): support long variable evaluation Jul 30, 2026
@jonathannorris
jonathannorris marked this pull request as ready for review July 30, 2026 15:46
@jonathannorris
jonathannorris requested a review from a team as a code owner July 30, 2026 15:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the DevCycle OpenFeature provider integration to support Long evaluations by upgrading the OpenFeature Java SDK to a version that includes FeatureProvider#getLongEvaluation, and adds regression tests to validate the SDK default narrowing behavior for Double-backed numbers.

Changes:

  • Bump dev.openfeature:sdk from 1.14.2 to 1.22.0.
  • Add DevCycleProviderTest coverage for getLongEvaluation (beyond-int range success, fractional mismatch, and unsafe-range mismatch).

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

File Description
build.gradle Bumps OpenFeature SDK dependency to 1.22.0 to enable long evaluation support.
src/test/java/com/devcycle/sdk/server/openfeature/DevCycleProviderTest.java Adds tests that exercise the OpenFeature SDK default getLongEvaluation behavior against DevCycle’s Double-backed numeric variables.
Comments suppressed due to low confidence (1)

src/test/java/com/devcycle/sdk/server/openfeature/DevCycleProviderTest.java:223

  • This comment attributes the mismatch to precision loss, but 2^53 is exactly representable as a double. The reason it should be rejected is that it is outside the SDK’s declared safe-integer range (max 2^53−1). Updating the wording makes the test rationale accurate.
        // 2^53 exceeds the double safe-integer range, so it cannot be narrowed to a long without precision loss.
        Double variableValue = 9_007_199_254_740_992.0;

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/test/java/com/devcycle/sdk/server/openfeature/DevCycleProviderTest.java Outdated

@toddbaert toddbaert left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there official docs about the 2^53 limitation?

@jonathannorris
jonathannorris enabled auto-merge (squash) August 6, 2026 19:24
@jonathannorris
jonathannorris merged commit d79c870 into main Aug 7, 2026
9 checks passed
@jonathannorris
jonathannorris deleted the worktree-of-long-support branch August 7, 2026 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants